<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

<ui:composition>
	<h:head>
		<meta http-equiv="Content-Type"
			content="text/html; charset=ISO-8859-1" />
		<link type="text/css" rel="stylesheet" href="css/myform.css" />
		<title>Rede de Imóveis</title>
	</h:head>

	<f:view>
		<f:loadBundle basename="br.com.imob.properties.messages" var="labels" />

		<div id="header">

			<!-- MENU -->

			<ui:insert name="menu">
				<ui:include src="/paginas/menu.xhtml" />
			</ui:insert>

			<br style="clear: left" />
		</div>

		<h:form id="FormPesquisa">
			<rich:tabPanel id="panelDadosPesquisa" style="vertical-align:middle">
				<rich:tab id="tabDadosPesquisa">
					<f:facet name="header">
						<h:outputText value="Busca"></h:outputText>
					</f:facet>
					<h:panelGrid id="gridDadosCategoria" columns="3">
						<h:outputText value="#{labels.categoria}: "></h:outputText>
						<h:inputText id="categoria"
							value="#{categoriaSisBO.categoriaBusca}"></h:inputText>
						<h:commandButton action="#{categoriaSisBO.pesquisar}"
							value="#{labels.buscar}"></h:commandButton>
					</h:panelGrid>

					<br style="clear: left" />

					<rich:dataTable id="lista" value="#{categoriaSisBO.dadosPesquisa}"
						var="item" rows="3" columns="2"
						rendered="#{not empty categoriaSisBO.dadosPesquisa}">
						<h:column>
							<f:facet name="header">
								<h:outputText value="#{labels.descricao}"></h:outputText>
							</f:facet>
							<h:outputText value="#{item.categoria}"></h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Editar e Excluir" />
							</f:facet>
                    		&nbsp;&nbsp;
                    		<h:commandLink
								action="#{categoriaSisBO.exibirAlteracao}" title="Alterar"
								immediate="true">
								<h:graphicImage value="/resources/icones/alterar.png" />
								<f:setPropertyActionListener value="#{item}"
									target="#{categoriaSisBO.dadosForm}" />
							</h:commandLink>
							&nbsp;&nbsp;
							<h:commandLink action="#{categoriaSisBO.exibirExclusao}"
								title="Excluir" immediate="true">
								<h:graphicImage value="/resources/icones/excluir.png" />
								<f:setPropertyActionListener value="#{item}"
									target="#{categoriaSisBO.dadosForm}" />
							</h:commandLink>
						</h:column>
						<f:facet name="footer">
							<rich:dataScroller for="lista" pageIndexVar="pageIndex"
								pagesVar="pages">
								<f:facet name="pages">
									<h:outputText value="#{pageIndex}/#{pages}" />
								</f:facet>
							</rich:dataScroller>
						</f:facet>
					</rich:dataTable>
				</rich:tab>
			</rich:tabPanel>
			<h:commandButton action="#{categoriaSisBO.exibirInclusao}"
				value="#{labels.incluir}"></h:commandButton>

		</h:form>
		<rich:messages></rich:messages>
	</f:view>

</ui:composition>
</html>